<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                                 xmlns:h="http://java.sun.com/jsf/html"
                                 xmlns:f="http://java.sun.com/jsf/core"
                                 xmlns:ui="http://java.sun.com/jsf/facelets"
                                 xmlns:p="http://primefaces.org/ui"
                                 template="/templates/ui.xhtml">
    <ui:define name="head">
        <link type="text/css" href="#{request.contextPath}/UI/epss/epss.css" rel="stylesheet"/>
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                    else
                        event.srcElement.click();
                }
            }
        </script>
    </ui:define>
    <ui:define name="content">
        <h:form id="form">
            <p:growl id="msgs" showDetail="false"/>
            <p:contextMenu for="pdt" id="pcm">
                <p:menuitem value="浏览" icon="ui-icon-arrowrefresh-1-w"
                            actionListener="#{itemSubcttAction.selectRecordAction('Sel')}"
                            update="pgView,pdt,msgs"
                            onclick="PF('wVDlgView').show()">
                </p:menuitem>
            </p:contextMenu>
            <p:dataTable id="pdt" style="width:100%;"
                         value="#{itemSubcttAction.itemOfEsItemHieRelapList}"
                         var="record"
                         rowKey="#{record.pkid}"
                         selection="#{itemSubcttAction.itemOfEsItemHieRelapSelected}"
                         selectionMode="single"
                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks}
                                         {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         paginator="true"
                         paginatorPosition="bottom"
                         rows="20"
                         rowsPerPageTemplate="200,100,50,30,20,10"
                         rowIndexVar="row"
                         emptyMessage="数据记录为空..."
                         rowStyleClass="#{record.name eq '合计'? 'rowDoneStyle': record.name eq '总合计'? 'rowDoneStyle':null}"
                         scrollable="true">
                <p:ajax event="rowSelect" listener="#{itemSubcttAction.onRowSelect}" update=":form:pgView"/>
                <p:column style="width:40px" headerText="序号">
                    <h:outputText value="#{row + 1}"/>
                </p:column>
                <p:column style="width:100px" headerText="成本项号">
                    <h:outputText value="#{record.strCorrespondingItemNo}" escape="false"/>
                </p:column>
                <p:column style="width:200px" headerText="成本项名">
                    <h:outputText value="#{record.strCorrespondingItemName}"/>
                </p:column>
                <p:column style="width:100px" headerText="分包编号">
                    <h:outputText value="#{record.strNo}" escape="false"/>
                </p:column>
                <p:column style="width:200px" headerText="分包名称">
                    <h:outputText value="#{record.name}" />
                </p:column>
                <p:column style="width:60px" headerText="分包单位">
                    <h:outputText value="#{record.unit}" style="text-align:right"/>
                </p:column>
                <p:column style="width:80px" headerText="分包单价">
                    <h:outputText value="#{record.contractUnitPrice}" style="float: right" >
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:80px" headerText="分包数量">
                    <h:outputText value="#{record.contractQuantity}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:80px" headerText="分包金额">
                    <h:outputText value="#{record.contractAmount}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:100px" headerText="分包甲供材单价">
                    <h:outputText value="#{record.signPartAPrice}" style="float: right">
                        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                    </h:outputText>
                </p:column>
                <p:column style="width:100px" headerText="分包备注">
                    <h:outputText value="#{record.note}" />
                </p:column>
            </p:dataTable>
            <p:dialog id="dlgView" header="分包合同内容查询" widgetVar="wVDlgView"
                      resizable="false" modal="true"
                      showEffect="clip" hideEffect="fold">
                <h:panelGrid id="pgView">
                    <h:panelGrid columns="2">
                        <p:outputLabel for="noItemHieRelap" value="项目编号：" />
                        <h:inputText id="noItemHieRelap"
                                     value="#{itemSubcttAction.itemOfEsItemHieRelap.strNo}"
                                     readonly="true"
                                     style="background-color:gainsboro;">
                        </h:inputText>
                        <p:outputLabel for="name" value="项目名称：" />
                        <h:inputText id="name" value="#{itemSubcttAction.itemOfEsItemHieRelap.name}"
                                     readonly="true"
                                     style="background-color:gainsboro;width:328px;"/>
                    </h:panelGrid>
                    <h:panelGrid columns="4">
                        <p:outputLabel for="contractQuantityItemInfo" value="合同数量："/>
                        <h:inputText id="contractQuantityItemInfo"
                                     value="#{itemSubcttAction.itemOfEsItemHieRelap.contractQuantity}"
                                     style="background-color:gainsboro;text-align:right;"
                                     readonly="true">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                        </h:inputText>
                        <p:outputLabel for="contractUnitPriceItemInfo" value="综合单价："/>
                        <h:inputText id="contractUnitPriceItemInfo"
                                     value="#{itemSubcttAction.itemOfEsItemHieRelap.contractUnitPrice}"
                                     readonly="true"
                                     style="background-color:gainsboro;text-align:right;">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            <p:ajax event="blur" update="contractAmountItemInfo"
                                    listener="#{itemSubcttAction.blurCalculateAmountAction}"/>
                        </h:inputText>
                        <p:outputLabel for="contractAmountItemInfo" value="合同金额："/>
                        <h:inputText id="contractAmountItemInfo"
                                     value="#{itemSubcttAction.itemOfEsItemHieRelap.contractAmount}"
                                     style="background-color:gainsboro;text-align:right;"
                                     readonly="true">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                        </h:inputText>
                        <p:outputLabel for="signPartAPriceItemInfo" value="甲供材价："/>
                        <h:inputText id="signPartAPriceItemInfo"
                                     value="#{itemSubcttAction.itemOfEsItemHieRelap.signPartAPrice}"
                                     style="background-color:gainsboro;text-align:right;"
                                     readonly="true">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                        </h:inputText>
                        <p:outputLabel for="unitItemInfo" value="单位："/>
                        <h:inputText id="unitItemInfo" value="#{itemSubcttAction.itemOfEsItemHieRelap.unit}"
                                     style="background-color:gainsboro;"
                                     readonly="true"/>
                        <p:outputLabel for="note" value="备注内容：" />
                        <h:inputText id="note" value="#{itemSubcttAction.itemOfEsItemHieRelap.note}"
                                     style="background-color:gainsboro;"
                                     readonly="true"/>
                        <p:outputLabel for="originFlagItemInfo" value="数据来源：" />
                        <h:inputText id="originFlagItemInfo"
                                     value="#{esCommon.originFlagListValueOfAlias(
                                                 itemSubcttAction.itemOfEsItemHieRelap.originFlag)}"
                                     style="background-color:gainsboro"
                                     readonly="true"/>
                        <p:outputLabel for="createdByItemInfo" value="创建人：" />
                        <h:inputText id="createdByItemInfo" value="#{itemSubcttAction.itemOfEsItemHieRelap.createdByName}"
                                     style="background-color:gainsboro"
                                     readonly="true"/>
                        <p:outputLabel for="createdDateItemInfo" value="创建时间：" />
                        <h:inputText id="createdDateItemInfo" value="#{itemSubcttAction.itemOfEsItemHieRelap.createdDate}"
                                     style="background-color:gainsboro"
                                     readonly="true"/>
                        <p:outputLabel for="lastUpdByItemInfo" value="修改人：" />
                        <h:inputText id="lastUpdByItemInfo" value="#{itemSubcttAction.itemOfEsItemHieRelap.lastUpdByName}"
                                     style="background-color:gainsboro"
                                     readonly="true"/>
                        <p:outputLabel for="lastUpdDateItemInfo" value="修改时间：" />
                        <h:inputText id="lastUpdDateItemInfo" value="#{itemSubcttAction.itemOfEsItemHieRelap.lastUpdDate}"
                                     style="background-color:gainsboro"
                                     readonly="true"/>
                        <p:outputLabel for="modificationNumItemInfo" value="修改次数：" />
                        <h:inputText id="modificationNumItemInfo" value="#{itemSubcttAction.itemOfEsItemHieRelap.modificationNum}"
                                     style="background-color:gainsboro;text-align:right;"
                                     readonly="true">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0"/>
                        </h:inputText>
                        <p:outputLabel for="strCorrespondingItemNo" value="对应编号：" />
                        <h:inputText id="strCorrespondingItemNo"
                                     value="#{itemSubcttAction.itemOfEsItemHieRelap.strCorrespondingItemNo}"
                                     style="background-color:gainsboro"
                                     readonly="true">
                        </h:inputText>
                    </h:panelGrid>
                </h:panelGrid>
            </p:dialog>
        </h:form>
    </ui:define>
</ui:composition>